import request from '@/utils/request'

// 查询部门列表,此接口method为get
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}

// 删除departments
export const delDepartments = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 新增部门,method:'post'
export const addDepartments = data => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 获取部门详情
export function getDeptDetail(id) {
  return request({
    url: '/company/department/' + id
  })
}

// 编辑部门详情
export function editDeptDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
